//
//  UIView+Category.h
//  ChangGengHospital
//
//  Created by 章松 on 16/11/3.
//  Copyright © 2016年 zhangsong. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Category)

@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat bottom;
@property (nonatomic, assign) CGFloat right;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGPoint origin;
@property (nonatomic, assign) CGSize size;



/**
 *  view添加描边和设置描边的宽度和颜色
 *
 *  @param borderWidth  描边的宽度
 *  @param borderColor  描边的颜色
 *  @param cornerRadius 圆角的弧度
 */
-(void)viewLayerBorderWidth:(float )borderWidth borderColor:(UIColor *)borderColor cornerRadius:(CGFloat )cornerRadius;

- (void)viewShadowWithRect:(CGRect)rect
                   Corners:(UIRectCorner)corners
               cornerRadii:(CGSize)radii
               shadowColor:(UIColor *)color shadowOffset:(CGSize)offset shadowOpacity:(CGFloat)opacity;

+(UIView *)creatViewFrame:(CGRect)frame backgroundColor:(UIColor *)backgroundColor;

+(UIView *)creatViewFrame:(CGRect)frame onView:(UIView *)onView backgroundColor:(UIColor *)backgroundColor;

//最大的y值
-(CGFloat)maxY;
//最小的y值
-(CGFloat)y;
//最大的x值
-(CGFloat)maxX;
//最小的x值
-(CGFloat)x;
//宽度
-(CGFloat)width;
//高度
-(CGFloat)height;
//中心点y
-(CGFloat)centerY;
//中心点x
-(CGFloat)centerX;
//size
-(CGSize)size;
//origin
-(CGPoint)origin;


/**
 找到view所在控制器
 
 @return 控制器
 */
- (UIViewController *)currentViewController;
@end
